package application.employee.model;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import platform.persistence.model.ModelBase;

/**
 * 雇员信息
 *
 * @author roamer
 * @version V1.0
 * @date 2019-02-24 10:21
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Document(collection = "employee")
public class Employee extends ModelBase {

    private static final long serialVersionUID = 1L;

    /** 雇员代码 */
    @Field("code")
    private String code;

    /** 雇员名称 */
    @Field("name")
    private String name;

    /**
     * 雇员详情
     * {@link EmployeeDetail}
     */
    @Field(DETAIL_FIELD)
    private EmployeeDetail employeeDetail;

    /** 查询常量 */
    public static final String DETAIL_FIELD = "employeeDetail";
}


